1. Field of the Invention
The invention relates to a method for updating firmware, and more particularly to a method for updating firmware of a battery.
2. Description of the Related Art
Generally, some problems associated with a battery of a portable electronic device (e.g., a notebook computer) may be addressed by updating firmware of the battery, instead of replacing the battery. FIG. 1 illustrates such a conventional portable electronic device 1, which includes a rechargeable battery module 100. The rechargeable battery module 100 includes a battery 11, a battery monitoring unit 12 and a non-volatile memory 13. The battery monitoring unit 12 is capable of monitoring a power state of the battery. The non-volatile memory 13 may be a programmable read-only memory (PROM), and is stored with a booting instruction set 14 that enables the battery 11 to complete a basic booting operation, and a main instruction set 15 that is used to manage a power supply state of the battery 11.
Typically, the term “firmware update” refers to operations for updating the main instruction set 15 stored in the non-volatile memory 13. This can be achieved through a firmware updating procedure as shown in FIG. 2.
In step 21 of the firmware updating procedure, an application associated with firmware updating is executed by a processor a central processing unit) of the conventional portable electronic device 1, responsive to a user-initiated activation command (for example, sent by a user under an operating system). The processor 16 executing the application then causes an embedded controller 17 (such as a keyboard controller), via a chipset 19, to notify the battery monitoring unit 12 of the rechargeable battery module 100 to perform a firmware update in step 22.
The battery monitoring unit 12 then determines whether the battery 11 supports the firmware update in step 23. When such a determination is affirmative, in step 24, the application causes the embedded controller 17 to write a segment of updated firmware into the non-volatile memory 13 of the rechargeable battery module 100, via the battery monitoring unit 12. Afterward, when the segment of the updated firmware has been successfully written into the non-volatile memory 13, in step 25, the battery monitoring unit 12 notifies the embedded controller 17 accordingly. The procedure may be terminated when the segment of the updated firmware is not written into the non-volatile memory 13.
The application then determines whether the entire updated firmware has been successfully written into the non-volatile memory 13 in step 26, and notifies the battery monitoring unit 12 that the firmware updating procedure is completed in 27. When the determination made in step 26 is not affirmative, the flow goes back to step 24 to perform another writing operation to write another segment of the updated firmware into the non-volatile memory 13.
In order to transmit the updated firmware to the non-volatile memory 13, the application first invokes a set of advanced configuration and power interface source language (ASL) code from a basic input/output system (BIOS) 18 of the conventional portable electronic device 1. Thus, the application is able to cause the embedded controller 17 to communicate with the battery monitoring unit 12 using a system management bus (SMBUS) interconnection. That is, to execute the firmware updating procedure, at least the operating system, the BIOS, the battery monitoring unit 12, the embedded controller 17, and the chipset 19 are involved. When communication between two of the many involved components is interrupted, the firmware updating procedure may not be completed correctly.
Furthermore, the updated firmware typically has a size (e.g., 4K Bytes) larger than the maximum capacity that can be transmitted using the SMBUS. As a result, steps 24 to 26 may have to be repeated numerous times in order to transmit the entire updated firmware to the non-volatile memory 13 in order to complete the firmware updating procedure. The repeated writing operations may lead to an increase of the time taken for the firmware updating procedure.